home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / US Robotics_MNP.CCL < prev    next >
Encoding:
Text File  |  1992-09-18  |  26.1 KB  |  812 lines  |  [TEXT/MPS ]

  1. !
  2. ! US Robotics modem CCL script using software MNP protocol
  3. !
  4. !    Change History-
  5. !        v1.0        09/21/90    gs:General Release Version
  6. !        v1.0.2        12/07/90    gs:Create minor release version
  7. !
  8. !    The following label ranges (0-255) are defined for all scripts:
  9. !
  10. !    Label        Function
  11. !    -----        --------
  12. !    0-19        Communications Setup
  13. !    20-39        Get a Modem (IBX switch thru)
  14. !    40-59        Modem Setup
  15. !    60-79        Dialing
  16. !    80-99        Physical Connection
  17. !    100-119        GEIS Logon
  18. !    120-139        CICS
  19. !    140-159        APPM
  20. !    160-179        Online
  21. !    180-199        Terminate Session
  22. !    200-209        Cancel
  23. !    210-219        Hangup
  24. !    230-239        <UNUSED>
  25. !    240-255        Disconnect
  26. !
  27. !    Note:        Label 210 is the modem hangup sequence
  28. !                Label 240 is reserved as the start of the disconnect sequence
  29. !
  30. !================================================================================
  31. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  32. !================================================================================
  33. !
  34. !    Select the MNPSerial Tool, initialize some parameters and open the session.
  35. !
  36. !    CTBTOOL <Toolname> [<LabelIfToolDoesn'tExist>] [<LabelIfError>] [<ctb flags>] [<buffer sizes>]
  37. CTBTool "MNPSerial Tool" 4 5
  38. !    CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
  39. CTBParameter MNPAutoEngage On 6
  40. CTBParameter MNPAutoengageString "CONNECT ~Baud\13" 7
  41. CTBParameter MNPConnectionMode Initiator 8
  42. CTBParameter MNPAutoEngageDelay 30 9
  43. CTBParameter MNPConnectAtOpen No 10
  44. CTBParameter MNPCloseConnectionIfMNPFails Yes 11
  45. CTBParameter Baud ~Baud 12
  46. CTBParameter Port "~MPrt" 13
  47. !    Dont set Data, Stop, or Parity bits for S/W MNP (defaults to 8,1,0 in the tool)
  48. !
  49. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  50. CTBOpen 14 15        ! Open the Communications session
  51. !
  52. !    Flush any data, Initialize script variables and define Cancel label
  53. Flush                ! clear input buffer and ring buffer
  54. CanBtn 200            ! If user cancels, take the error return
  55. !
  56. SetVar 1 0            ! #of consecutive no responses to hangup command
  57. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  58. SetVar 3 0            ! #of consecutive network contact failures.
  59. SetVar 4 0            ! #of logon validation failures
  60. SetVar 5 0            ! #of consecutive CICS90  failures
  61. SetVar 6 0            ! #of consecutive APPM failures
  62. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  63. SetVar 8 0            ! not used
  64. !
  65. Jump 20                ! Go to Modem Selection and Setup
  66. !
  67. !*********
  68. -LABEL 4    !---<MNPSerial Tool missing>---
  69. !*********
  70. Alert -1 The MNP Serial tool cannot be found in your System folder.\13Please install it, and try again.
  71. Exit -1                ! exit the script with an error
  72. !
  73. !*********
  74. -LABEL 5    !---<CTBTool Comm Toolbox err>---
  75. !*********
  76. Alert -1 A CTBTool error has occurred in the Communications Toolbox.\13Please try again.\13If the problem continues, call the Apple USA helpline.
  77. Exit -1                ! exit the script with an error.
  78. !
  79. !*********
  80. -LABEL 6    !---<CTBParameter MNPAutoengage failed>---
  81. !*********
  82. Alert -1 CTBParameter MNPAutoengage caused an error.
  83. Exit -1                ! exit the script with an error.
  84. !
  85. !*********
  86. -LABEL 7    !---<CTBParameter MNPAutoengageString failed>---
  87. !*********
  88. Alert -1 CTBParameter MNPAutoengageString caused an error.
  89. Exit -1                ! exit the script with an error.
  90. !
  91. !*********
  92. -LABEL 8    !---<CTBParameter MNPConnectionMode failed>---
  93. !*********
  94. Alert -1 CTBParameter MNPConnectionMode caused an error.
  95. Exit -1                ! exit the script with an error.
  96. !
  97. !*********
  98. -LABEL 9    !---<CTBParameter MNPAutoEngageDelay failed>---
  99. !*********
  100. Alert -1 CTBParameter MNPAutoEngageDelay caused an error.
  101. Exit -1                ! exit the script with an error.
  102. !
  103. !*********
  104. -LABEL 10    !---<CTBParameter MNPConnectAtOpen failed>---
  105. !*********
  106. Alert -1 CTBParameter MNPConnectAtOpen caused an error.
  107. Exit -1                ! exit the script with an error.
  108. !
  109. !*********
  110. -LABEL 11    !---<CTBParameter MNPCloseConnectionIfMNPFails failed>---
  111. !*********
  112. Alert -1 CTBParameter MNPCloseConnectionIfMNPFails caused an error.
  113. Exit -1                ! exit the script with an error.
  114. !
  115. !*********
  116. -LABEL 12    !---<CTBParameter Baud failed>---
  117. !*********
  118. Alert -1 CTBParameter Baud caused an error.
  119. Exit -1                ! exit the script with an error.
  120. !
  121. !*********
  122. -LABEL 13    !---<CTBParameter Port failed>---
  123. !*********
  124. Alert -1 CTBParameter Port caused an error.
  125. Exit -1                ! exit the script with an error.
  126. !
  127. !*********
  128. -LABEL 14    !---<CTBOpen failed>---
  129. !*********
  130. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  131. Exit -1                ! exit the script with an error.
  132. !
  133. !**********
  134. -LABEL 15    !---<CTBOpen err>---
  135. !**********
  136. Alert -1 CTBOpen caused an Communications Toolbox error.
  137. Exit -1                ! exit the script with an error.
  138. !
  139. !================================================================================
  140. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  141. !================================================================================
  142. !
  143. !================================================================================
  144. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  145. !================================================================================
  146. DsplyPic 1
  147. DsplyMsg Making sure the US Robotics modem is ready.
  148. Jsr 210                ! Hang up (just in case)
  149. SetVar 1 0            ! clear # hangup tries counter
  150. !
  151. !**********
  152. -LABEL 42    ! ---<Got modem attention>---
  153. !**********
  154. DsplyMsg Setting modem parameters.
  155. !    Clear all previous MatchStr's and setup the modem
  156. MatchStr 1 42 Dummy
  157. Wait 30                ! Give modem .5 second to get ready before sending the attention chars
  158. Xmit AT
  159. !    Send US Robotics modem specific commands
  160. Wait 3                ! Pause before "L1" command
  161. Xmit L1
  162. Wait 3                ! Pause before "&M0" command
  163. Xmit &M0
  164. Wait 3                ! Pause before "S0=0" command
  165. Xmit S0=0
  166. Wait 3                ! Pause before "turn off the command echo" command
  167. Xmit E0
  168. Wait 3                ! Pause before "verbal result messages" command
  169. Xmit V1
  170. Wait 3                ! Pause before "select all result codes" command
  171. Xmit X1
  172. Wait 3
  173. Flush                ! clear input buffer and send Carriage Return (CR)
  174. Xmit \13
  175. !
  176. !    Look for one of the following expected responses
  177. MatchStr 1 60 OK
  178. Wait 180               ! wait 3 secs
  179. IncVar 2            ! increment # modem setup tries
  180. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  181. DsplyMsg Modem does not respond to setup commands. Retrying ...
  182. Jump 42                ! else try modem setup again
  183. !
  184. !**********
  185. -LABEL 44    ! ---<Modem configuration err>---
  186. !**********
  187. Bell
  188. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  189. SetVar 2 0            ! clear # modem setup tries
  190. Jump 40                ! reset modem and try again
  191. !
  192. !================================================================================
  193. -LABEL 60    !***<Modem ready>*** Dial phone
  194. !================================================================================
  195. DsplyMsg Dialing ~Fone ...
  196. DsplyPic 2
  197. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  198. MatchStr 1 60 Dummy
  199. SetVar 2 0            ! clear #modem setup tries
  200. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  201. Xmit AT
  202. Wait 3                ! Pause before "tone dial" command
  203. Xmit D~Tone
  204. Wait 3                ! Pause before phone number
  205. Xmit ~Fone
  206. Wait 3
  207. Flush                ! clear input buffer and send CR
  208. Xmit \13
  209. !
  210. !    Look for one of the following expected responses
  211. MatchStr 1 80 ~Baud\13
  212. MatchStr 2 66 CARRIER
  213. MatchStr 3 70 BUSY
  214. MatchStr 4 74 NO DIAL
  215. MatchStr 5 62 ERROR
  216. MatchStr 6 80 1200\13
  217. MatchStr 7 80 2400\13
  218. MatchStr 8 80 4800\13
  219. MatchStr 9 80 9600\13
  220. Wait 2100            ! wait 35 secs
  221. !
  222. !**********
  223. -LABEL 62    !---<No response or ERROR from modem>---
  224. !**********
  225. IncVar 3            ! Increment # dial attempts counter
  226. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  227. DsplyMsg Modem does not respond to Dial command. Retrying ...
  228. Jump 40                ! reset modem and try again
  229. !
  230. !**********
  231. -LABEL 64    !---<No dial response err>---
  232. !**********
  233. Bell
  234. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  235. SetVar 3 0            ! clear # dial attempts counter
  236. Jump 40                ! reset modem and try again
  237. !
  238. !**********
  239. -LABEL 66   !---<No Carrier>---
  240. !**********
  241. IncVar 3            ! Increment # dial attempts counter
  242. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  243. DsplyMsg No Carrier with phone number dialed. Retrying ...
  244. Jump 40                ! reset modem and try again
  245. !
  246. !**********
  247. -LABEL 68    !---<No carrier err>---
  248. !**********
  249. Bell
  250. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  251. SetVar 3 0            ! clear # dial attempts counter
  252. Jump 40                ! reset modem and try again
  253. !
  254. !**********
  255. -LABEL 70    !---<busy>---
  256. !**********
  257. IncVar 3            ! Increment # dial attempts counter
  258. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  259. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  260. Wait 300            ! wait 5 secs
  261. DsplyMsg Phone number dialed is busy. Retrying ....
  262. Jump 40                ! reset modem and try again
  263. !
  264. !**********
  265. -LABEL 72    !---<Busy err>---
  266. !**********
  267. Bell
  268. Alert 200 All network access lines are in use.\13Try again later.
  269. SetVar 3 0            ! clear # dial attempts counter
  270. Jump 40                ! reset modem and try again
  271. !
  272. !**********
  273. -LABEL 74    !---<No Dialtone>---
  274. !**********
  275. IncVar 3            ! Increment # dial attempts counter
  276. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  277. DsplyMsg Modem reports no dial tone. Retrying ...
  278. Jump 40                ! reset modem and try again
  279. !
  280. !**********
  281. -LABEL 76   !---<No dialtone Error>---
  282. !**********
  283. Bell
  284. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  285. SetVar 3 0            ! clear # dial attempts counter
  286. Jump 40                ! reset modem and try again
  287. !
  288. !================================================================================
  289. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  290. !================================================================================
  291. DsplyMsg Requesting network attention
  292. !    Look for one of the following expected responses
  293. MatchStr 1 84 NO CARRIER
  294. MatchStr 2 100 U#
  295. Wait 12                ! Wait 0.2 sec before sending the first H
  296. Xmit H
  297. Wait 21                ! Wait another 0.35 sec before sending the second H
  298. Xmit H
  299. Wait 600            ! Allow 10 seconds for the U# to show up
  300. IncVar 3            ! No U#, increment # dial attempts counter
  301. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  302. DsplyMsg Unable to get network attention. Retrying ...
  303. Jump 40                ! reset modem and try again
  304. !
  305. !**********
  306. -LABEL 82    !---<No U#>---
  307. !**********
  308. Bell
  309. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  310. SetVar 3 0            ! clear # dial attempts counter
  311. Jump 40                ! reset modem and try again
  312. !
  313. !**********
  314. -LABEL 84    !---<Line dropped>---
  315. !**********
  316. IncVar 3            ! Increment # dial attempts counter
  317. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  318. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  319. Jump 40                ! reset modem and try again
  320. !
  321. !**********
  322. -LABEL 86   !---<Line dropped Err>---
  323. !**********
  324. Bell
  325. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  326. SetVar 3 0            ! clear # dial attempts counter
  327. Jump 40                ! reset modem and try again
  328. !
  329. !================================================================================
  330. -LABEL 100    !***<GEIS logon>***
  331. !================================================================================
  332. !
  333. DsplyMsg Physical Connection established. Logging on to network ...
  334. DsplyPic 3
  335. SetVar 3 0            ! clear # dial attempts counter
  336. Wait 6                ! wait 0.1 sec
  337. Flush                ! clear input buffer
  338. !    Note: leave 2 spaces between ~Dist and ~Numb
  339. Xmit ~User,~Dist  ~Numb,~Ridn\13
  340. !
  341. !    Look for one of the following expected responses
  342. MatchStr 1 104 NO CARRIER
  343. MatchStr 2 106 DISCONNECTED
  344. MatchStr 3 120 ===>
  345. MatchStr 6 108 N FAULT,
  346. MatchStr 7 108 T FORMAT,
  347. MatchStr 8 110 L DENIED
  348. MatchStr 9 112 BUSY
  349. MatchStr 10 112 DOWN
  350. Wait 4200            ! wait up to 70 seconds for a response
  351. IncVar 4            ! Increment # logon attempts counter
  352. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  353. DsplyMsg No logon response from network. Retrying ...
  354. Jump 40                ! reset modem and try again
  355. !
  356. !*********
  357. -LABEL 102    !---<No Logon response>---
  358. !*********
  359. Bell
  360. Alert 200 No logon response from network.\13Try again.
  361. SetVar 4 0            ! clear # logon attempts counter
  362. Jump 40                ! reset modem and try again
  363. !
  364. !*********
  365. -LABEL 104    !---<Carrier dropped>---
  366. !*********
  367. IncVar 4            ! Increment # login attempts counter
  368. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  369. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  370. Jump 40                ! reset modem and try again
  371. !
  372. !*********
  373. -LABEL 105    !---<Carrier dropped Err>---
  374. !*********
  375. Bell
  376. Alert 200 Carrier signal dropped during network logon.\13Try again.
  377. SetVar 4 0            ! clear # logon attempts counter
  378. Jump 40                ! reset modem and try again
  379. !
  380. !*********
  381. -LABEL 106    !---<Session disconnected>---
  382. !*********
  383. IncVar 4            ! Increment # logon attempts counter
  384. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  385. DsplyMsg Network connection dropped during network logon. Retrying ...
  386. Jump 40                ! reset modem and try again
  387. !
  388. !*********
  389. -LABEL 107    !---<Session disconnected Err>---
  390. !*********
  391. Bell
  392. Alert 200 Network connection dropped during network logon.\13Try again.
  393. SetVar 4 0            ! clear # logon attempts counter
  394. Jump 40                ! reset modem and try again
  395. !
  396. !*********
  397. -LABEL 108    !---<Validation fault>---
  398. !*********
  399. IncVar 4            ! Increment # logon attempts counter
  400. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  401. DsplyMsg Network rejected your identification. Retrying ...
  402. Wait 60                ! wait 1 sec
  403. Jump 100            ! retry GEIS login (only case where we don't reset)
  404. !
  405. !*********
  406. -LABEL 109    !---<validation fault err>---
  407. !*********
  408. Bell
  409. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  410. SetVar 4 0            ! clear # logon attempts counter
  411. Jump 40                ! reset modem and try again
  412. !
  413. !*********
  414. -LABEL 110    !---<Denied by host>---
  415. !*********
  416. IncVar 4            ! Increment # logon attempts counter
  417. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  418. DsplyMsg Network host equipment problem detected. Retrying ...
  419. Jump 40                ! reset modem and try again
  420. !
  421. !*********
  422. -LABEL 111    !---<Denied by host err>---
  423. !*********
  424. Bell
  425. Alert 200 Network host equipment problem detected.\13Try again.
  426. SetVar 4 0            ! clear # logon attempts counter
  427. Jump 40                ! reset modem and try again
  428. !
  429. !*********
  430. -LABEL 112    !---<MARK3K access busy/down>---
  431. !*********
  432. IncVar 4            ! Increment # logon attempts counter
  433. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  434. DsplyMsg Network equipment busy/down. Retrying ...
  435. Jump 40                ! reset modem and try again
  436. !
  437. !*********
  438. -LABEL 113    !---<MARK3K access busy/down err>---
  439. !*********
  440. Bell
  441. Alert 200 Network equipment busy or down.\13Try again.
  442. SetVar 4 0            ! clear # logon attempts counter
  443. Jump 40                ! reset modem and try again
  444. !
  445. !================================================================================
  446. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  447. !================================================================================
  448. !
  449. DsplyMsg Requesting access to network subsystem ...
  450. DsplyPic 4
  451. Wait 6                ! wait 0.1 secs
  452. Flush                ! clear input buffer
  453. !
  454. Xmit ~CICS\13
  455. !    Look for one of the following expected responses
  456. MatchStr 3 140 READY
  457. !    To overcome a network problem, the following label was changed from 124 to 126
  458. !    MatchStr 4 124 T BOUND
  459. MatchStr 4 126 T BOUND
  460. MatchStr 5 126 UNRECOGN
  461. MatchStr 6 126 ===>
  462. Wait 3600            ! Allow 60 secs for the expected responses to show up
  463. IncVar 5            ! Timeout, so increment # CICS tries counter
  464. IfVar 5 2 122        ! if 3 tries, display No Response alert
  465. DsplyMsg No response to network subsystem request. Retrying ...
  466. Jump 40                ! reset modem and try again
  467. !
  468. !*********
  469. -LABEL 122    !---<No CICS err>---
  470. !*********
  471. Bell
  472. Alert 200 No response to network subsystem request.\13Try again.
  473. SetVar 5 0            ! clear # CICS tries counter
  474. Jump 40                ! reset modem and try again
  475. !
  476. !*********
  477. -LABEL 124    !---<Session not bound err>---
  478. !*********
  479. Bell
  480. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  481. Jump 200            ! jump to cancel routine
  482. !
  483. !*********
  484. -LABEL 126    !---<Invalid application>---
  485. !*********
  486. IncVar 5            ! Increment # CICS tries counter
  487. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  488. DsplyMsg Network subsystem request has been rejected. Retrying ...
  489. Wait 60                ! wait 1 sec
  490. Flush
  491. Jump 120            ! try to access CICS again
  492. !
  493. !*********
  494. -LABEL 127    !---<Invalid application err>---
  495. !*********
  496. Bell
  497. Alert 200 The network subsystem request has been rejected.\13Try again.
  498. SetVar 5 0            ! clear # CICS tries counter
  499. Flush
  500. Jump 40                ! reset modem and try again
  501. !
  502. !================================================================================
  503. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  504. !================================================================================
  505. !
  506. DsplyMsg Requesting access to distribution center ~Dist ...
  507. DsplyPic 5            ! Highlight box 5 on screen
  508. SetVar 5 0            ! clear # CICS tries counter
  509. !                    ! Send what needs to be sent
  510. Xmit ~Epgm~Dist\13
  511. !    Look for one of the following expected responses
  512. Wait 12                ! wait 0.2 secs
  513. Flush                ! clear input buffer
  514. !    Look for one of the following expected responses
  515. MatchStr 3 160 C100
  516. MatchStr 4 144 INVALID
  517. Wait 3600            ! Allow 60 secs for the expected responses to show up
  518. !
  519. IncVar 6            ! Timeout, so Increment # APPM tries counter
  520. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  521. DsplyMsg No response to distribution center access request. Retrying ...
  522. Jump 40                ! reset modem and try again
  523. !
  524. !*********
  525. -LABEL 142    !---<No transaction response>---
  526. !*********
  527. Bell
  528. Alert 200 No response to distribution center access.\13Try again.
  529. SetVar 6 0            ! reset # APPM tries counter
  530. Jump 40                ! reset modem and try again
  531. !
  532. !*********
  533. -LABEL 144    !---<Invalid transaction>---
  534. !*********
  535. IncVar 6            ! Increment # APPM tries counter
  536. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  537. DsplyMsg Distribution center access request rejected. Retrying ...
  538. Jump 40                ! reset modem and try again
  539. !
  540. !*********
  541. -LABEL 145    !---<Invalid transaction err>---
  542. !*********
  543. Bell
  544. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  545. SetVar 6 0            ! reset # APPM tries counter
  546. Jump 40                ! reset modem and try again
  547. !
  548. !================================================================================
  549. -LABEL 160    !***<Online>***
  550. !================================================================================
  551. !
  552. Wait 60                ! wait 1 sec
  553. DsplyMsg Accessing the distribution center ~Dist ...
  554. DsplyPic 6            ! Highlight box 6 on screen
  555. !    C9 = pass msg thru GE, 899 = Echo cmd
  556. Xmit C9899Ole\13
  557. !    Look for one of the following expected responses
  558. MatchStr 2 162 C5
  559. MatchStr 3 164 Ole\13
  560. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  561. !
  562. !*********
  563. -LABEL 162    !---<no luck this time>--- 
  564. !*********
  565. DsplyMsg Distribution center is not available ...
  566. Jsr 180                ! terminate session
  567. Bell
  568. Alert -1 Distribution center is not available.\13Please try again later.
  569. Jump 200            ! exit to Cancel routine
  570. !
  571. !*********
  572. -LABEL 164    !---<Success, but did MNP sync up?>--- 
  573. !*********
  574. !
  575. !    CTBCHECKPARAMETER <ParameterName> <ValueToCheckAgainst>
  576. !                      <LabelIfMatch> [<LabelIfParameterNotFound>] [<LabelIfError>]
  577. CTBCheckParameter MNPStatus On 170 168 169
  578. CTBCheckParameter MNPStatus Off 165 168 169
  579. CTBCheckParameter MNPStatus Connecting 166 168 169
  580. CTBCheckParameter MNPStatus Disconnecting 167 168 169
  581. !
  582. DisplyMsg Error in Communications
  583. Jsr 180                ! terminate session
  584. Bell
  585. Alert -1 Warning: The MNP Status is unknown.\13The session has been terminated.
  586. Jump 200            ! exit to Cancel routine
  587. !
  588. !*********
  589. -LABEL 165    !---<MNP Status was Off>---
  590. !*********
  591. DisplyMsg Error in Communications
  592. Jsr 180                ! terminate session
  593. Bell
  594. Alert -1 Warning: The MNP Status is Off.\13The session has been terminated.
  595. Jump 200            ! exit to Cancel routine
  596. !
  597. !*********
  598. -LABEL 166    !---<MNP Status was Connecting>---
  599. !*********
  600. DisplyMsg Error in Communications
  601. Jsr 180                ! terminate session
  602. Bell
  603. Alert -1 Warning: The MNP Status is Connecting.\13The session has been terminated.
  604. Jump 200            ! exit to Cancel routine
  605. !
  606. !*********
  607. -LABEL 167    !---<MNP Status was Disconnecting>---
  608. !*********
  609. DisplyMsg Error in Communications
  610. Jsr 180                ! terminate session
  611. Bell
  612. Alert -1 Warning: The MNP Status is Disconnecting.\13The session has been terminated.
  613. Jump 200            ! exit to Cancel routine
  614. !
  615. !*********
  616. -LABEL 168    !---<MNP Status was not recognized>---
  617. !*********
  618. DisplyMsg Error in Communications
  619. Jsr 180                ! terminate session
  620. Bell
  621. Alert -1 MNPStatus was not recognized as a valid parameter.\13Call the Apple USA HelpLine.
  622. Jump 200            ! exit to Cancel routine
  623. !
  624. !*********
  625. -LABEL 169    !---<CTBCheckParameter error>---
  626. !*********
  627. DisplyMsg Error in Communications
  628. Jsr 180                ! terminate session
  629. Bell
  630. Alert -1 An error occurred in the CTBCheckParameter function.\13Call the Apple USA HelpLine.
  631. Jump 200            ! exit to Cancel routine
  632. !
  633. !*********
  634. -LABEL 170    !---<Success, we’re in, so exit>--- 
  635. !*********
  636. Wait 30                ! wait 0.5 secs
  637. Flush                ! clear input buffer
  638. Exit 0                ! exit the script normally
  639. !
  640. !================================================================================
  641. -LABEL 180-199    !***<Terminate Session>***
  642. !================================================================================
  643. !
  644. !*********
  645. -LABEL 180    !---<Terminate session>--- 
  646. !*********
  647. !    send Abnormal disconnect command
  648. Xmit C3\13
  649. !    Look for one of the following expected responses
  650. MatchStr 1 182 U#
  651. Wait 300            ! wait 5 secs
  652. Return
  653. !
  654. !*********
  655. -LABEL 182    !---<Say bye>---
  656. !*********
  657. Wait 6                ! wait 0.1 sec and sign off the network
  658. Xmit BYE\13
  659. Return
  660. !
  661. !================================================================================
  662. -LABEL 200    !***<Cancel Routine>***
  663. !================================================================================
  664. DsplyMsg Canceling ...
  665. Flush
  666. Wait 30                ! wait 0.5 secs
  667. Exit -1                ! exit the script with an error
  668. !
  669. !================================================================================
  670. -LABEL 210    !***<Hang up phone Routine>***
  671. !================================================================================
  672. !
  673. !    Look for one of the following expected responses
  674. MatchStr 1 222 CARRIER
  675. SetVar 1 0            ! clear # hangup tries counter
  676. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  677. ! If MNP is on, turn it off first or the modem will not understand the Hangup command
  678. !
  679. !    CTBCHECKPARAMETER <ParameterName> <ValueToCheckAgainst>
  680. !                      <LabelIfMatch> [<LabelIfParameterNotFound>] [<LabelIfError>]
  681. CTBCheckParameter MNPStatus Off 220 168 169            
  682. CTBCheckParameter MNPStatus Connecting 212 168 169
  683. CTBCheckParameter MNPStatus Disconnecting 213 168 169        
  684. !    CTBPARAMETER <ParameterName> <NewValue> [<LabelIfError>]
  685. CTBParameter MNPStatus Off 215        ! MNP was on, so turn it off
  686. !    Check it again, just in case
  687. CTBCheckParameter MNPStatus Off 220 168 169
  688. Jump 220            ! MNP turned off OK, so finish hanging up
  689. !
  690. !*********
  691. -LABEL 212    !---<MNPStatus is Connecting>---
  692. !*********
  693. IncVar 2            ! Increment # MNPstatus checks counter
  694. IfVar 2 3 214        ! if 3 checks, display alert and exit script with error
  695. Alert 200 MNPStatus is Connecting.
  696. Wait 30                ! wait 0.5 secs
  697. Jump 210            ! try to hang up again
  698. !
  699. !*********
  700. -LABEL 213    !---<MNPStatus is Disconnecting>---
  701. !*********
  702. IncVar 2            ! Increment # MNPstatus checks counter
  703. IfVar 2 3 214        ! if 3 checks, display alert and exit script with error
  704. Alert 200 MNPStatus is Disconnecting.
  705. Wait 30                ! wait 0.5 secs
  706. Jump 210            ! try to hang up again
  707. !
  708. !*********
  709. -LABEL 214    !---<MNPStatus is Connecting or Disconnecting>---
  710. !*********
  711. Alert 200 MNPStatus is still Connecting or Disconnecting.\13Script exiting with an error.
  712. Exit -1                ! exit the script with an error
  713. !
  714. !*********
  715. -LABEL 215    !---<CTBParameter Error>---    
  716. !*********
  717. Alert 200 CTBParameter MNPStatus Off caused an error.\13Call the Apple USA HelpLine.
  718. Exit -1                ! exit the script with an error
  719. !
  720. !*********
  721. -LABEL 220    !---<Hang up the phone subroutine>---
  722. !*********
  723. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  724. Xmit +
  725. Xmit +
  726. Xmit +
  727. Wait 60                ! wait 1 more sec (end guard time)
  728. Flush                ! clear input buffer and tell modem to hang up verbosely
  729. Xmit ATV1H\13
  730. !    Look for one of the following expected responses
  731. MatchStr 2 222 OK
  732. MatchStr 3 224 ERROR
  733. Wait 120            ! wait 2 secs
  734. Jump 224            ! test for error or no response            
  735. !
  736. !*********
  737. -LABEL 222    !---<Reset the modem>---
  738. !*********
  739. !
  740. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  741. !                      This aids in script debugging so we dont reset modem 1st time.
  742. Flush                ! Flush the buffer and send Hayes Reset Modem command
  743. Xmit ATZ\13
  744. !    Look for one of the following expected responses
  745. MatchStr 2 229 OK
  746. MatchStr 3 224 ERROR
  747. Wait 180            ! wait 3 secs
  748. !
  749. !*********
  750. -LABEL 224    !---<Error or just no response>---
  751. !*********
  752. IncVar 1            ! Increment # hangup tries counter
  753. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  754. Jump 220            ! try to hangup again
  755. !
  756. !*********
  757. -LABEL 225    !---<Error>---
  758. !*********
  759. IfVar 7 1 229        ! If disconnecting, just return.
  760. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  761. SetVar 1 0            ! clear # hangup tries counter
  762. Jump 220            ! try to hangup again
  763. !
  764. !*********
  765. -LABEL 229    !---<Return from the Hangup sequence>---
  766. !*********
  767. Wait 60                ! wait 1 sec
  768. Flush                ! clear input buffer
  769. Return
  770. !
  771. !================================================================================
  772. -LABEL 230-239    !***<UNUSED>***
  773. !================================================================================
  774. !
  775. !================================================================================
  776. -LABEL 240    !***<Disconnection Sequence>***
  777. !================================================================================
  778. !
  779. !    If the connection is closed, we cant hangup, so just exit
  780. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  781. CTBIFCLOSED 246
  782. !
  783. SetVar 7 1            ! We're disconnecting, so set the flag
  784. !    Look for one of the following expected responses
  785. MatchStr 1 242 U#
  786. MatchStr 2 244 NO CARRIER
  787. Wait 60                ! wait 1 sec
  788. Jump 244            ! and hang up the phone
  789. !
  790. !*********
  791. -LABEL 242    !---<Sign off the network>---
  792. !*********
  793. Xmit BYE\13
  794. Wait 120            ! wait 2 secs
  795. !
  796. !*********
  797. -LABEL 244    !---<Hang up the phone>---
  798. !*********
  799. SetVar 1 0            ! clear the # hangup tries counter
  800. Jsr 210                ! Execute the Hang-up subroutine
  801. !    No CTBClose here because the connection is closed externally from the script
  802. !    in case we exited the script with an error before completion.
  803. Flush                ! clear input buffer
  804. Exit 0                ! exit the script normally
  805. !
  806. !*********
  807. -LABEL 246    !---<Connection Was Closed>---
  808. !*********
  809. Flush                ! clear input buffer
  810. Exit 0                ! exit the script normally
  811. ###
  812.